home *** CD-ROM | disk | FTP | other *** search
/ Sounds Terrific 1 / Sounds Terrific CD (1994)(Weird Science)(Disc 2 of 2)[!][Amiga-PC].iso / modules / n / nnconv.mod < prev    next >
Encoding:
Text File  |  1994-08-04  |  2.0 KB  |  74 lines

  1. NNCONV.MOD - Convert your old NN*.NET files to new format...
  2. Bad Dude #1 @9981
  3. Friday, December 6, 1991 at 7:52 pm
  4.      The following post will be the UUencoded NNCONV.EXE file.  They are both
  5. the same mod; it is up to you if you want to compile yourself or just UUdecode
  6. it. 
  7.  
  8.      Compile this, and place in your main BBS DATA directory, and run it.  If
  9. you already have created an NNALL.NET file, it will still add your old   
  10. NN*.NET files to the NNALL.NET file, but you may want to check and make sure  
  11. that you dont get duplicates.  After running this, and making sure there are  
  12. no errors, you can delete your old NN#####.NET files.  If you have problems  
  13. or comments, please send mail to me at 1@9981. Thanks!
  14.  
  15. NOTE: You MUST have WWIV v4.20e (Revision E) for this mod to work.
  16.  
  17. -------------------------------------------------------------------------------
  18. /* NNCONV.MOD by Bad Dude (1@9981);  Convert old NN*.NET files to new NNALL.NET
  19.    format.  December 6, 1991 */
  20.  
  21. #include <stdio.h>
  22. #include <dir.h>
  23.  
  24. void main(void)
  25. {
  26.   int i=0,i1=0,done;
  27.   char s[12],s1[12];
  28.   struct ffblk ffblk;
  29.   FILE *oldnn, *newnn;
  30.  
  31.   done = findfirst("NN*.NET",&ffblk,0);
  32.   if (strcmp(ffblk.ff_name,"NNALL.NET")==0)
  33.     done = findnext(&ffblk);
  34.  
  35.   if ((newnn = fopen("NNALL.NET","at")) == NULL)
  36.   {
  37.     printf("Error opening NNALL.NET");
  38.     exit (1);
  39.   }
  40.  
  41.   printf("NNALL.NET:\n");
  42.   while (!done)
  43.   {
  44.     while (ffblk.ff_name[i] != NULL)
  45.     {
  46.       if (ffblk.ff_name[i] >= '0' && ffblk.ff_name[i] <= '9')
  47.       {
  48.         s[i1]=ffblk.ff_name[i];
  49.         i1++;
  50.       }
  51.       i++;
  52.     }
  53.     s[i1]=0;
  54.     i=0;
  55.     i1=0;
  56.  
  57.     if((oldnn = fopen(ffblk.ff_name,"rt")) == NULL)
  58.     {
  59.       printf("Error opening %s.\n",ffblk.ff_name);
  60.       exit(1);
  61.     }
  62.  
  63.     fgets(s1,6,oldnn);
  64.     fclose(oldnn);
  65.  
  66.     printf("%s %s",s,s1);
  67.     fprintf(newnn, "%s %s",s,s1);
  68.  
  69.     done = findnext(&ffblk);
  70.     if (strcmp(ffblk.ff_name,"NNALL.NET")==0)
  71.       done = findnext(&ffblk);
  72.   }
  73.   fclose(newnn);
  74. }